<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>buyfunshop</title>
		<meta name="customer-service" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta property="og:type"          content="website" />
		<meta property="og:title"         content="【buyfunshop】" />
		<meta property="og:description"   content="ช้อปปิ้งง่ายมาก! แพลตฟอร์มช้อปปิ้งที่เน้นผู้บริโภคแฟชั่นสตรี สินค้ามีทั้งเสื้อผ้าสตรีแฟชั่น รองเท้าผู้หญิง กระเป๋าสตรี เครื่องประดับ ฯลฯ จัดส่งฟรีเกิน 899/ดำเนินการเองอย่างเป็นทางการ/เก็บเงินปลายทาง/ระยะเวลาชื่นชมเจ็ดวัน " />
		<meta property="og:image"         content="//yinibuy2.oss-cn-hongkong.aliyuncs.com/729419af-b34f-4126-be31-e36aad7582dd.jpg" />
		<meta property="og:url"         content="www.buyfunshop.com" />		
		<link rel="stylesheet" href="../dists/mdui-0.4.3/css/mdui.css" />
		<link rel="stylesheet" href="../resources/css/common.css"/>
		<style>
			.mdui-bottom-nav{box-shadow: none; border-top-color: #F2F2F2 !important;}
		
			.mdui-container-fluid{margin-bottom: 50px; background: #FFFFFF; display: flex; position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; overflow: hidden;max-width: 750px;}
			.mdui-container-fluid ul.nav{width: 25%; background: #F7F7F7; overflow: auto;}
			.mdui-container-fluid ul.nav li{text-align: center; height: 64px; line-height: 64px;font-size: 15px;border-left: 4px solid transparent;}
			.mdui-container-fluid ul.nav li.active{background: #FFFFFF;color: #9F0000; font-weight: bold;border-left: 4px solid #9F0000;}
			
			.mdui-container-fluid ul.snav{width: 75%; overflow: auto;}
			.mdui-container-fluid ul.snav > li{display: flex; flex-wrap: wrap; display: none;}
			.mdui-container-fluid ul.snav > li > a{display: inline-block; width: 33%; box-sizing: border-box; padding: 8px 8px 16px 8px; text-align: center;font-size: 13px; color: #333; text-decoration: none;}
			.mdui-container-fluid ul.snav > li > a > img{width: 100%; max-width: 120px; display: block; margin: 0px auto 8px auto;}
			.mdui-container-fluid ul.snav > li > a > span{display: block;}
		</style>
	</head>
	<body class="mdui-bottom-nav-fixed">
		
		<div class="mdui-container-fluid"></div>
		
		<div class="mdui-bottom-nav">
			<a href="../item/list.html" class="mdui-ripple">
				<svg t="1586933246590" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8037" width="48" height="48"><path d="M556.586667 159.36l288.490666 183.914667A64 64 0 0 1 874.666667 397.248v392.746667a64 64 0 0 1-64 64H555.456l0.021333-196.992H490.666667v196.992H234.666667a64 64 0 0 1-64-64v-398.293334a64 64 0 0 1 30.272-54.4l287.530666-178.346666a64 64 0 0 1 68.138667 0.426666zM810.666667 790.016V397.226667L522.197333 213.333333 234.666667 391.68v398.336h192v-197.013333h192.810666v196.992H810.666667z" p-id="8038" fill="#2A363B"></path></svg>
				<label class="language" language="shou_ye"></label>
			</a>
			<a href="#" class="mdui-ripple mdui-bottom-nav-active">
				<svg t="1587007028153" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7377" width="24" height="24"><path d="M256 734.101333v64H170.666667v-64h85.333333z m597.333333 0v64H298.666667v-64h554.666666zM256 493.184v64H170.666667v-64h85.333333z m597.333333 0v64H298.666667v-64h554.666666zM256 252.245333v64H170.666667v-64h85.333333z m597.333333 0v64H298.666667v-64h554.666666z" p-id="7378" fill="#ff4142"></path></svg>
				<label class="language" language="fen_lei"></label>
			</a>
			<a onclick="customerCart.openCart();" class="mdui-ripple">
				<svg t="1586933455682" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9017" width="48" height="48"><path d="M330.666667 768a53.333333 53.333333 0 1 1 0 106.666667 53.333333 53.333333 0 0 1 0-106.666667z m384 0a53.333333 53.333333 0 1 1 0 106.666667 53.333333 53.333333 0 0 1 0-106.666667zM94.762667 160h54.741333a96 96 0 0 1 92.906667 71.786667l1.024 4.394666L256.64 298.666667h0.213333l42.88 205.333333L332.224 661.333333h402.218667l61.653333-298.666666H313.813333l-13.376-64h495.68a64 64 0 0 1 62.677334 76.949333l-61.653334 298.666667A64 64 0 0 1 734.442667 725.333333H332.224a64 64 0 0 1-62.677333-51.050666l-60.586667-293.418667-0.405333 0.085333-27.733334-131.562666a32 32 0 0 0-28.309333-25.237334l-2.986667-0.149333H94.741333v-64h54.741334z" p-id="9018" fill="#2A363B"></path></svg>
				<label class="language" language="gou_wu_che"></label>
			</a>
			<a href="../user/index.html" class="mdui-ripple">
				<svg t="1586934464276" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9180" width="48" height="48"><path d="M644.8 581.568l160.64 187.456A64 64 0 0 1 756.842667 874.666667H267.157333a64 64 0 0 1-48.597333-105.642667l160.661333-187.434667c18.922667 11.52 39.466667 20.629333 61.205334 26.944L267.157333 810.666667H480v-128h64v128h212.842667l-173.269334-202.133334a254.613333 254.613333 0 0 0 61.226667-26.965333zM512 149.333333c117.824 0 213.333333 95.509333 213.333333 213.333334s-95.509333 213.333333-213.333333 213.333333-213.333333-95.509333-213.333333-213.333333S394.176 149.333333 512 149.333333z m0 64a149.333333 149.333333 0 1 0 0 298.666667 149.333333 149.333333 0 0 0 0-298.666667z" p-id="9181" fill="#2A363B"></path></svg>
				<label class="language" language="wo_de"></label>
			</a>
		</div>
	</body>
	<script src="../dists/mdui-0.4.3/js/mdui.js"></script>
	<script src="../dists/art-template/template-web.js"></script>
	<script src="../resources/js/echo.js"></script>
	<script src="../resources/js/common.js"></script>
	<script>
	  !function(f,b,e,v,n,t,s)
	  {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
	  n.callMethod.apply(n,arguments):n.queue.push(arguments)};
	  if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
	  n.queue=[];t=b.createElement(e);t.async=!0;
	  t.src=v;s=b.getElementsByTagName(e)[0];
	  s.parentNode.insertBefore(t,s)}(window, document,'script',
	  'https://connect.facebook.net/en_US/fbevents.js');
	  fbq('init', commonConfig.getFbPiexId());
	  fbq('track', 'PageView');
	</script>
	
	<script id="catalog-navs" type="text/html">
		<ul class="nav">
			<% for (var i = 0; i < shopNavs.length; i++) { %>
			<li attr_id="<%=shopNavs[i].id%>"><%=shopNavs[i].name%></li>
			<% } %>
		</ul>
		<ul class="snav">
			<% for (var i = 0; i < shopNavs.length; i++) { %>
			<%if (shopNavs[i].thumb && shopNavs[i].thumb != 'dists/super/images/nav_add_holder.png'){%>
			<li style="justify-content: center" attr_id="<%=shopNavs[i].id%>">
				<a style="width: 95%; padding-bottom: 8px;" href="list.html?id=<%=shopNavs[i].id%>">
					<img style="max-width: 100%; border-radius: 8px;" src="<%=shopNavs[i].thumb%>">
				</a>
			</li>
			<%}%>
			<li attr_id="<%=shopNavs[i].id%>">
				<% for (var j = 0; j < shopNavs[i].subs.length; j++) { %>
					<a href="slist.html?_id=<%=shopNavs[i].id%>&_subId=<%=shopNavs[i].subs[j].id%>">
						<img src="<%=shopNavs[i].subs[j].thumb%>">
						<span><%=shopNavs[i].subs[j].name%></span>
					</a>
				<% } %>
			</li>
			<% } %>
		</ul>
	</script>
	
	<script>
		$$(function() {
			app.init();
		});
		var app = {
			datas: {
				navInfo: null
			},
			methods: {				
				initNavs: function(){
					app.datas.navInfo = cacheSessionStorage.getCache('_navInfo');
					if (!app.datas.navInfo || app.datas.navInfo.length == 0) {
						tools.loading(2000);
						$$.ajax({
							url: commonConfig.websitePrefix() + "/api/shop",
							success: function (data) {
								app.datas.navInfo = data.datas;
								cacheSessionStorage.setCache('_navInfo', app.datas.navInfo);
								app.methods.renderNavInfo();
							},
							complete: function () {
								tools.hideLoading();
							}
						})
					} else {
						app.methods.renderNavInfo();
					}
				},
				renderNavInfo: function(){
					var showNavs = [] ; 
					$$.each(app.datas.navInfo.shopNavs, function (i, nav) {
					    if(nav.isShow){
					        var showSubs = [] ;
					        $$.each(nav.subs, function (j, sub) {
					            if(sub.isShow){
					                showSubs.push(sub);
					            }
					        });
					        if(showSubs.length > 0){
					            nav.subs = showSubs ; 
					            showNavs.push(nav);
					        }
					    }
					});
					
					$$('.mdui-container-fluid').html(template('catalog-navs', {'shopNavs': showNavs}));
					app.events.navClick();
					$$('.mdui-container-fluid ul.nav li').eq(0).trigger('click');
				}
			},
			events: {
				navClick: function(){
					$$('.mdui-container-fluid ul.nav li').off('click').on('click', function (e) {
						$$('.mdui-container-fluid ul.nav li').removeClass('active');
						$$(this).addClass('active');
						
						
						$$('.mdui-container-fluid ul.snav > li').hide();
						var _currentDomAttrId = $$(this).attr('attr_id') ;
						
						$$('.mdui-container-fluid ul.snav > li').map(function (i, element) {
						  	if($$(element).attr('attr_id') == _currentDomAttrId) {
						  		$$(element).css('display' , 'flex');
						  	}
						});
					});
				}
			},
			init: function() {
				app.methods.initNavs();
			}
		}
	</script>
</html>
